home *** CD-ROM | disk | FTP | other *** search
- class smashing.Phys
- {
- static var pUp;
- static var gr = 700;
- static var fr = 0.75;
- static var bf = 0.7;
- static var height = 370;
- static var width = 600;
- static var TWOPI = 6.283185307179586;
- function Phys()
- {
- }
- static function drag(f, t)
- {
- return f * Math.pow(t,smashing.Phys.fr);
- }
- static function bounce(v, n)
- {
- var _loc2_ = v.reverse();
- var _loc1_ = n.multiply(n.dot(_loc2_));
- v.x = _loc1_.x * smashing.Phys.bf + (_loc1_.x - _loc2_.x);
- v.y = _loc1_.y * smashing.Phys.bf + (_loc1_.y - _loc2_.y);
- }
- static function get up()
- {
- return smashing.Phys.pUp != undefined ? smashing.Phys.pUp : (smashing.Phys.pUp = new smashing.Point(0,-1));
- }
- }
-